package panel;

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.FlowLayout;

import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.border.Border;

import listener.LoginListener;

public class HomePage extends JFrame{
	
	public static HomePage instance=new HomePage();
	
	JLabel zhanghao=new JLabel("账号:");
	JLabel password=new JLabel("密码:");
	public JTextField zh=new JTextField(15);
	public JPasswordField ps=new JPasswordField(15);
	public JButton login=new JButton("登录");
	JPanel jLogin=new JPanel();
	JPanel jPassword=new JPanel();
	public JLabel picture=null;
	Icon icon=new ImageIcon("img/0.jpg");
	public HomePage(){
		this.setSize(700,500);
		this.setTitle("登录");
		setLayout(null);
		picture=new JLabel(icon);
		jLogin.add(zhanghao);
		jLogin.add(zh);
		jPassword.add(password);
		jPassword.add(ps);
		jLogin.setBounds(170, 300, 300, 30);
		jPassword.setBounds(170, 350, 300, 30);
		login.setBounds(280, 400, 80,30);
		picture.setBounds(130, 20, 400, 250);
		this.add(jLogin);
		this.add(jPassword);	
		this.add(login);
		this.add(picture);
		LoginListener listener=new LoginListener();
		login.addActionListener(listener);
		this.setLocationRelativeTo(null);//位于屏幕中央
		this.setResizable(false);//设置此窗体是否可由用户调整大小
		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);//设置默认关闭操作
	}
		
	public void addListener(){
		
	}
	public static void main(String[] args){
		instance.setVisible(true);
	}
}
